package com.rany.day06.demo04;

import java.util.Calendar;

public class CalendarTest {
    public static void main(String[] args) {
        //Calendar是一个抽象类，所以调用静态方法getInstance转换为子类，左父右子是多态
        Calendar calendar = Calendar.getInstance();
        System.out.println(calendar);
        int i = calendar.get(Calendar.YEAR);
        System.out.println(i);
        int i1 = calendar.get(Calendar.MONTH);
        System.out.println(i1);

        calendar.set(Calendar.YEAR,1997);
        calendar.set(Calendar.MONTH,2);
    }
}
